<%--
  Created by IntelliJ IDEA.
  User: yangpengjie
  Date: 2022/12/26
  Time: 16:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
  <%@include file="common_css.jsp"%>
    <script src="${pageContext.request.contextPath}/style/js/jquery-3.5.1.js"></script>
</head>
<html>
<form id="frm">
<div class="col-xl-6 col-lg-6">
  <div class="card">
    <div class="card-header">
      <h4>Billing Details</h4>
    </div>
    <div class="card-body">
      <form>
        <div class="row">
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="text-input" class="col-form-label">名字</label>
              <input name="name" class="form-control" type="text" placeholder="">
            </div>
          </div>
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="text-input" class="col-form-label">教师编号</label>
              <input name="teacherId" class="form-control" type="text" placeholder="">
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="text-input" class="col-form-label">联系方式</label>
              <input name="phone" class="form-control" type="text" placeholder="">
            </div>
          </div>
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="text-input" class="col-form-label">身份</label>
              <input name="identity" class="form-control" type="text" placeholder="">
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="region" class="col-form-label">性别</label>
              <select name="sex" class="select2 form-control" id="region">
<%--                <optgroup label="Alaskan/Hawaiian Time Zone">--%>
                  <option value="男">男</option>
                  <option value="女">女</option>
<%--                  <option value="HI">Hawaii</option>--%>
<%--                </optgroup>--%>
<%--                <optgroup label="Pacific Time Zone">--%>
<%--                  <option value="CA">California</option>--%>
<%--                  <option value="NV">Nevada</option>--%>
<%--                  <option value="OR">Oregon</option>--%>
<%--                  <option value="WA">Washington</option>--%>
              </select>
            </div>
          </div>
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="text-input" class="col-form-label">年龄</label>
              <input name="age" class="form-control" type="text" placeholder="" id="text-input">
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label class="col-form-label">邮件地址</label>
              <input name="email" class="form-control" type="text">
            </div>
          </div>
          <div class="col-xl-6 col-lg-6">
            <div class="form-group">
              <label for="State" class="col-form-label">科目</label>
              <select name="subject" class="select2 form-control" id="State">
                <option value="计算机">计算机</option>
                <option value="软件工程">软件工程</option>
                <option value="CA">网络工程</option>
              </select>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-form-label">身份证号码</label>
          <input name="identityId" class="form-control" type="text" placeholder="">
        </div>
        <div class="form-group mb-0">
          <div class="checkbox mb-3">
            <input id="checkbox1" type="checkbox">
            <label for="checkbox1">check me out</label>
          </div>
        </div>
        <div class="form-group mb-0">
          <button onclick="doMessage()" class="btn btn-primary squer-btn mt-2 mr-2" type="button" >Submit</button>
        </div>
      </form>
    </div>
  </div>
</div>
</form>
<%@include file="common_js.jsp"%>
</html>
<script>
    function doMessage(){
        $.ajax(
            {
                <%--url: "${pageContext.request.contextPath}/studentm",--%>
                url:"${pageContext.request.contextPath}/teacher?method=doMessage",
                type: "post",
                data: $("#frm").serialize(),
                async: false,  //设置同步
                success: function (response) {
                    if (response == 'ok') {
                        alert("信息填写成功，1秒后跳转到登录页面");
                        setTimeout("window.location.href='/jsp/client/TeacherLogin.jsp'", 1000)
                    } else {
                        alert("信息填写失败，请联系管理员!");
                    }
                }
            }
        )
    }
</script>